<!DOCTYPE html>
<html lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>新零售微店后台首页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link th:href="@{/style/font.css}"  rel="stylesheet">
    <link th:href="@{/style/Order.css}"  rel="stylesheet">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all">
    <script type="text/javascript" th:src="@{/laydate/laydate.js}"></script>
    <meta name="_csrf" th:content="${_csrf.token}"/>
    <meta name="_csrf_header"  th:content="${_csrf.headerName}"/>
    <style type="text/css">
        .product-price{
            width:50px;
            border: none;
        }
        #editor{
            margin-left: 120px;
        }
        .one-img{
            border: 1px solid red;
            height: 100px;
            width: 100px;
            margin-left: 110px;
        }
        .Fengetext{
            color: red;
        }
        .layui-card-header .layui-icon {
            line-height: initial;
            position: absolute;
            right: 0px;
            top: 50%;
            margin-top: -15px;
        }
        .upaction{
            background: red;
        }

        .addproduct{
            /*background: #3c3c3c;*/

        }
        .layui-input-block{
            margin-left:0px;
        }
        .layui-form-select dl {
            width: 250px;
        }
    </style>
</head>
<body class="mainbody">
<form id="form1">

    <!--导航栏-->
    <!--<div class="location">
      <a href="http://localhost:55708/admin/order/order_list.aspx" class="back"><i class="iconfont icon-up"></i><span>返回列表页</span></a>
      <a href="http://localhost:55708/admin/center.aspx"><i class="iconfont icon-home"></i><span>首页</span></a>
      <i class="arrow iconfont icon-arrow-right"></i>
      <a href="http://localhost:55708/admin/order/order_list.aspx"><span>订单管理</span></a>
      <i class="arrow iconfont icon-arrow-right"></i>
      <span>订单详细</span>
    </div>-->
    <!--<div class="line10"></div>-->
    <!--/导航栏-->

    <!--内容-->
    <div id="floatHead" class="content-tab-wrap">
        <div class="content-tab">
            <div class="content-tab-ul-wrap">
                <div class="tab-title"><span>订单详细信息</span><i class="iconfont icon-arrow-down"></i></div><ul>
                <li><a class="selected" href="javascript:;">订单详细信息</a></li>
            </ul>
            </div>
        </div>
    </div>

    <div class="tab-content">
        <dl>
            <dd style="margin-left:50px;text-align:center;">
                <div class="order-flow" style="width:560px">

                    <div class="item-box left arrive">
                        <div class="line"></div>
                        <div class="icon"><i class="iconfont icon-confirm-full"></i></div>
                        <div class="txt">
                            <b>订单已生成</b>
                            <p th:text="${orderDetails.pOrderTime}"></p>
                        </div>
                    </div>

                    <div th:if="${orderDetails.payTime!=null}" class="item-box arrive">
                    <div class="line"></div>
                    <div class="icon"><i class="iconfont icon-confirm-full"></i></div>
                    <div class="txt">
                    <b>付款时间</b>
                    <p th:text="${orderDetails.payTime}"></p>
                    </div>
                    </div>

                    <!--<div class="item-box arrive">-->
                        <!--<div class="line"></div>-->
                        <!--<div class="icon"><i class="iconfont icon-confirm-full"></i></div>-->
                        <!--<div class="txt">-->
                            <!--<b>已确认</b>-->
                            <!--<p>2018/8/20 20:31:38</p>-->
                        <!--</div>-->
                    <!--</div>-->

                    <div th:if="${orderDetails.orderStatus=='702'}"  class="item-box">
                        <div class="line"></div>
                        <div class="icon"><i class="iconfont icon-confirm-full"></i></div>
                        <div class="txt">
                            <b>等待发货</b>
                        </div>
                    </div>

                    <div th:if="${orderDetails.orderStatus=='703'}"  class="item-box">
                        <div class="line"></div>
                        <div class="icon"><i class="iconfont icon-confirm-full"></i></div>
                        <div class="txt">
                            <b>等待收货</b>
                        </div>
                    </div>

                    <!--<div class="item-box right">-->
                        <!--<div class="line"></div>-->
                        <!--<div class="icon"><i class="iconfont icon-confirm-full"></i></div>-->
                        <!--<div class="txt">-->
                            <!--<b>等待完成</b>-->
                        <!--</div>-->
                    <!--</div>-->

                </div>
            </dd>
        </dl>
        <dl>
            <dt>订单号</dt>
            <dd><span th:if="${orderDetails!=null}" th:text="${orderDetails.orderNo}" id="spanOrderNo"></span><input type="hidden" th:if="${orderDetails!=null}"   th:value="${orderDetails.userId}" id="userId"></dd>
            <dt>会员编号</dt>
            <dd><span   th:if="${orderDetails!=null}" th:text="${orderDetails.userNo+'-('+orderDetails.userName+')'}" id="userName"></span></dd>
            <dt>实际支付</dt>
            <dd><span   th:if="${orderDetails!=null}" th:text="${orderDetails.realPay}" id="realPay"></span></dd>
            <dt>订单利润</dt>
            <dd><span   th:if="${orderDetails!=null}" th:text="${orderDetails.orderProfit}" id="orderProfit"></span></dd>
            <dt>会员节省</dt>
            <dd><span   th:if="${orderDetails!=null}" th:text="${#numbers.formatDecimal(orderDetails.memberSave, 1, 2)}" id="memberSave"></span></dd>
        </dl>

        <dl>
            <dt>商品列表</dt>
            <dd>
                <div class="table-container">
                    <table border="0" cellspacing="0" cellpadding="0" class="border-table" width="100%">
                        <thead>
                        <tr>
                            <th style="text-align:left;">商品信息</th>
                            <th width="8%">销售价</th>
                            <th width="8%"></th>
                            <th width="8%">数量</th>
                            <th width="12%">金额合计</th>
                            <th width="8%"></th>
                        </tr>
                        </thead>
                        <tbody>

                        <tr class="td_c" th:if="${orderDetailsProductList!=null}" th:each="models:${orderDetailsProductList}">
                            <td th:text="${models.getProductName()}"  style="text-align:left;white-space:inherit;word-break:break-all;line-height:20px;">

                            </td>
                            <td th:text="${models.getProductPrice()}"></td>
                            <td></td>
                            <td th:text="${models.productCount}"></td>
                            <td th:text="${models.getProductPrice()* models.getProductCount()}"></td>
                            <td>
                                <a  th:each="log:${models.getLogList()}" th:if="${models.logisticsNo!=null}" onclick="query(this);"  th:data="${log}" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">
                                    物流
                                </a>
                            </td>
                        </tr>

                        </tbody>
                    </table>
                </div>
            </dd>
        </dl>


        <dl th:if="${changeProductList!=null&&changeProductList.size()>0}">
            <dt>改单产品</dt>
            <dd>
                <div id="changeProductTable" class="table-container">
                    <table border="0" cellspacing="0" cellpadding="0" class="border-table" width="100%">
                        <thead>
                        <tr>
                            <th width="8%" style="text-align:left;">编号</th>
                            <th width="8%">名字</th>
                            <th width="8%">数量</th>
                            <th width="8%">价格</th>
                            <th width="8%">
                                <!--操作-->
                            </th>
                        </tr>
                        </thead>
                        <tbody>

                        <tr class="td_c" th:each="model,num:${changeProductList}">
                            <td class="id" th:text="${model.id}">
                            </td>
                            <td class="name" th:text="${model.productname}"></td>
                            <td class="number"><input type="number" th:value="${model.productnumber}" min="0" step="1" max="100"></td>
                            <td class="price" th:text="${model.productprice}"></td>
                            <td th:if="${num.last==false}" th:rowspan="${num.size}">
<input style="position: inherit;" th:data="${model.productname}" name="btnEditAcceptInfo" type="hidden" id="changeproduct" class="ibtn" value="修改">
                            </td>

                        </tr>

                        </tbody>
                    </table>
                </div>
            </dd>
        </dl>

        <dl>
            <dt>收货信息</dt>
            <dd>
                <div class="table-container">
                    <table border="0" cellspacing="0" cellpadding="0" class="border-table" width="100%">
                        <tbody><tr>
                            <th width="20%">收件人</th>
                            <td>
                                <div class="position">
                                    <!--<span th:text="${orderDetails.getConsigneename()}" id="spanAcceptName"></span>-->
                                    <input type="text"   th:if="${orderDetails!=null}" th:value="${orderDetails.consigneename}" id="name" name="name" autocomplete="off" placeholder="请输入姓名"  class="layui-input">
                                    <!--<input th:data="${orderDetails.getAddressId()}" th:userId="${orderDetails.userId}" onclick="editLogAddress(this);" name="btnEditAcceptInfo" type="button" id="btnEditAcceptInfo" class="ibtn" value="修改">-->

                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th>手机</th>
                            <td><input type="text"  id="phone"   th:if="${orderDetails!=null}" th:value="${orderDetails.phone}"  name="phone" autocomplete="off"  class="layui-input"></td>
                        </tr>
                        <tr>
                            <th>发货地址</th>
                            <td><span data="0" id="address" disabled="disabled" th:adid="${orderDetails.provinceId+','+orderDetails.cityId+','+orderDetails.areaId}"  th:if="${orderDetails!=null && orderDetails.getProvincename()!=null}"  th:text="${orderDetails.getProvincename()+orderDetails.getCityname()+orderDetails.getAreaname()}"  >
                            </span>
                                <!--<span th:if="${orderDetails.getDetailAddr()!=null}"  th:text="${orderDetails.getDetailAddr()}" id="spanAddress"></span>-->
                            </td>

                        </tr>
                        <tr>
                            <th>物流类型</th>
                            <td>
                                <div class="layui-fluid">
                                    <div class="layui-card">
                                        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                                            <div class="layui-form-item">
                                                <form name="form" class="form">
                                                    <!--<label class="layui-form-label"></label>-->
                                                    <div class="layui-input-block">
                                                        <div class="layui-input-inline">
                                                            <select name="quiz1" id="logtype"  lay-verify="required"   lay-filter="selectlogtype">
                                                                <option th:if="${orderDetails.logisticalType==2}" selected="selected" value="2">快递</option>
                                                                <option th:unless="${orderDetails.logisticalType!=2}" value="1">自提</option>
                                                                <option th:if="${orderDetails.logisticalType==1}" selected="selected"  value="1">自提</option>
                                                                <option th:unless="${orderDetails.logisticalType!=1}"    value="2">快递</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>


                                    </div>
                                </div>

                            </td>
                        </tr>
                        <tr>
                            <th>选择地址</th>
                            <td>
                                <div class="layui-fluid">
                                    <div class="layui-card">
                                        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                                            <div class="layui-form-item">

                                                <!--<div class="layui-form-item">-->
                                                    <!--<form name="form" class="form">-->
                                                        <!--<label class="layui-form-label">物流类型</label>-->
                                                        <!--<div class="layui-input-block">-->
                                                            <!--<div class="layui-input-inline">-->

                                                            <!--</div>-->
                                                        <!--</div>-->
                                                    <!--</form>-->
                                                <!--</div>-->
                                                <div class="layui-form-item">
                                                    <form name="form" class="form">
                                                        <!--<label class="layui-form-label">选择地址</label>-->
                                                        <div class="layui-input-block">
                                                            <div class="layui-input-inline">
                                                                <select name="quiz1" id="yj"  lay-verify="required"   lay-filter="selectyj">
                                                                    <option value="0">请选择省份</option>
                                                                </select>
                                                            </div>
                                                            <div class="layui-input-inline">
                                                                <select name="quiz2" id="rj" lay-filter="selectrj">
                                                                </select>
                                                            </div>
                                                            <div class="layui-input-inline" >
                                                                <select name="quiz3" id="sj" lay-filter="selectsj">
                                                                </select>
                                                            </div>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>


                                    </div>
                                </div>


                            </td>

                        </tr>
                        <tr>
                            <th>详细地址</th>
                            <td>
                                <input type="text" id="detailAddress" th:value="${orderDetails.detailAddr}" name="detailAddress" autocomplete="off" placeholder="请输入详细地址"  class="layui-input">
                                <!--<span th:if="${orderDetails.detailAddr!=null}"  th:text="${orderDetails.detailAddr}" id="spanDetailAddr"></span>-->
                            </td>
                        </tr>
                        <tr>
                            <th>备注</th>
                            <td><div class="position">
                                <input style="width: 80%" type="text" id="remark" th:value="${orderDetails.remark}" name="remark" autocomplete="off" placeholder="请输入备注"  class="layui-input">
                                <input th:data="${orderDetails.getAddressId()}" th:sure="${orderDetails.addressId}" th:userId="${orderDetails.userId}" onclick="editchangeproduct(this);" name="btnEditAcceptInfo" type="button" id="btnEditAcceptInfo" class="ibtn" value="修改">
                            </div>
                            </td>
                        </tr>
                        <!--<tr>-->
                            <!--<th>备注</th>-->
                            <!--<td><div class="position">-->
                                <!--<input th:data="${orderDetails.getAddressId()}" th:userId="${orderDetails.userId}" onclick="editLogAddress(this);" name="btnEditAcceptInfo" type="button" id="btnEditAcceptInfo" class="ibtn" value="修改">-->
                            <!--</div>-->
                            <!--</td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--<th>邮政编码</th>-->
                        <!--<td><span id="spanPostCode"></span></td>-->
                        <!--</tr>-->

                        <!--<tr>-->
                        <!--<th>邮箱</th>-->
                        <!--<td><span id="spanEmail"></span></td>-->
                        <!--</tr>-->
                        </tbody></table>
                </div>
            </dd>
        </dl>

        <dl th:if="${cartList!=null&&cartList.size()>0}">
            <dt>改单记录</dt>
            <dd>
                <div id="changeProductTableList" class="table-container">
                    <table border="0" cellspacing="0" cellpadding="0" class="border-table" width="100%">
                        <thead>
                        <tr>
                            <th width="8%" style="text-align:left;">订单号</th>
                            <th width="8%">产品名字</th>
                            <th width="8%">数量</th>
                            <th width="8%">价格</th>
                            <th width="8%">余额</th>
                            <th width="8%">收货类型</th>
                            <th width="8%">收货人</th>
                            <th width="8%">电话</th>
                            <th width="8%">地址</th>
                            <th width="8%">物流单号</th>
                            <th width="8%">备注</th>
                            <th width="8%">改单人</th>
                            <th width="8%">操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        <tr class="td_c" th:if="${cartList!=null}"  th:each="model,num:${cartList}">
                            <td class="id" th:text="${model.orderNo}"></td>
                            <td class="name" th:if="${model.productName==''}">无</td>
                            <td class="name" th:if="${model.productName!=''}" th:text="${model.productName}"></td>
                            <td class="number" th:text="${model.pCount}"></td>
                            <td class="price" th:text="${model.productPrice}"></td>
                            <td class="price1" th:if="${model.oldAmount==null}" >0</td>
                            <td class="price1" th:if="${model.oldAmount!=null}" th:text="${model.oldAmount}"></td>
                            <td class="price1" th:if="${model.logisticsType==2}" th:text="${'快递'}"></td>
                            <td class="price1" th:if="${model.logisticsType==1}" th:text="${'自提'}"></td>

                            <td class="price1" th:text="${model.consigneename}"></td>
                            <td class="price1" th:text="${model.phone}"></td>
                            <td class="price1" th:text="${model.provincename+model.cityname+model.areaname+model.detailAddr}"></td>
                            <td class="price1" th:text="${model.logisticalNo}"></td>
                            <td class="price1" th:text="${model.remark}"></td>
                            <td class="price1" th:text="${model.adminName}"></td>
                            <td class="price1"></td>
                            <!--<td th:if="${num.last==false}" th:rowspan="${num.size}">-->
                            <!--<input style="position: inherit;" th:data="${model.userId}" onclick="editchangeproduct(this);" name="btnEditAcceptInfo" type="button" id="changeproduct" class="ibtn" value="修改">-->
                            <!--</td>-->

                        </tr>

                        </tbody>
                    </table>
                </div>
            </dd>
        </dl>

        <!--<dl id="dlUserInfo">-->
            <!--<dt>会员信息</dt>-->
            <!--<dd>-->
                <!--<div class="table-container">-->
                    <!--<table border="0" cellspacing="0" cellpadding="0" class="border-table" width="100%">-->
                        <!--<tbody><tr>-->
                            <!--<th width="20%">会员编号</th>-->
                            <!--<td><span th:text="${orderDetails.getUserName()}" id="lbUserName"></span></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                            <!--<th>会员组别</th>-->
                            <!--<td><span id="lbUserGroup"></span></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                            <!--<th>购物折扣</th>-->
                            <!--<td><span id="lbUserDiscount"></span></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                            <!--<th>账户余额</th>-->
                            <!--<td><span id="lbUserAmount">0.00</span> 元</td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                            <!--<th>账户积分</th>-->
                            <!--<td><span id="lbUserPoint">0</span> 分</td>-->
                        <!--</tr>-->
                        <!--</tbody></table>-->
                <!--</div>-->
            <!--</dd>-->
        <!--</dl>-->
        <!--<dl>-->
            <!--<dt>支付配送</dt>-->
            <!--<dd>-->
                <!--<div class="table-container">-->
                    <!--<table border="0" cellspacing="0" cellpadding="0" class="border-table" width="100%">-->
                        <!--<tbody><tr>-->
                            <!--<th width="20%">支付方式</th>-->
                            <!--<td>货到付款</td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                            <!--<th>配送方式</th>-->
                            <!--<td></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                            <!--<th>是否开具发票</th>-->
                            <!--<td></td>-->
                        <!--</tr>-->

                        <!--<tr>-->
                            <!--<th>用户留言</th>-->
                            <!--<td></td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                            <!--<th valign="top">订单备注</th>-->
                            <!--<td>-->
                                <!--<div class="position">-->
                                    <!--<div id="divRemark"></div>-->
                                    <!--<input name="btnEditRemark" type="button" id="btnEditRemark" class="ibtn" value="修改">-->
                                <!--</div>-->
                            <!--</td>-->
                        <!--</tr>-->

                        <!--</tbody></table>-->
                <!--</div>-->
            <!--</dd>-->
        <!--</dl>-->
        <dl>
            <dt>订单统计</dt>
            <dd>
                <div class="table-container">
                    <table border="0" cellspacing="0" cellpadding="0" class="border-table" width="100%">
                        <tbody>
                        <tr>
                            <th width="20%">订单总金额</th>
                            <td>
                                <div class="position">
                                    <span th:text="${orderDetails.orderMoney}" id="spanRealAmountValue"></span> 元

                                </div>
                            </td>
                        </tr>
                        <!--<tr>-->
                            <!--<th>订单总金额</th>-->
                            <!--<td th:text="${orderDetails.orderMoney}" ></td>-->
                        <!--</tr>-->
                        <tr>
                            <th>运费</th>
                            <td>
                                <div class="position">
                                    <span th:text="${orderDetails.freight}"  id="spanExpressFeeValue"></span> 元

                                </div>
                            </td>
                        </tr>
                        <!--<tr>-->
                            <!--<th>支付手续费</th>-->
                            <!--<td>-->
                                <!--<div class="position">-->
                                    <!--<span id="spanPaymentFeeValue">0.00</span> 元-->

                                <!--</div>-->
                            <!--</td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                            <!--<th>发票税金</th>-->
                            <!--<td>-->
                                <!--<div class="position">-->
                                    <!--<span id="spanInvoiceTaxesValue">0.00</span> 元-->

                                <!--</div>-->
                            <!--</td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                            <!--<th>积分总计</th>-->
                            <!--<td>-->
                                <!--<div class="position">-->
                                    <!--+800 分-->
                                <!--</div>-->
                            <!--</td>-->
                        <!--</tr>-->
                        </tbody></table>
                </div>
            </dd>
        </dl>
    </div>
    <!--/内容-->


    <!--工具栏-->
    <div class="page-footer">
        <div class="btn-wrap" style="position: fixed;">


            <!--<input name="btnExpress" type="button" id="btnExpress" value="确认发货" class="btn">-->

            <!--<input name="btnCancel" type="button" id="btnCancel" value="取消订单" class="btn green">-->

            <!--<input id="btnPrint" type="button" value="打印订单" class="btn violet">-->
            <!--<input id="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);">-->

        </div>
    </div>
    <!--/工具栏-->


    <!-- End Browser Link -->

</form>
</body>
<script th:src="@{/layui/layui.js}"></script>
<script th:src="@{/layui/jquery.min.js}"></script>
<script th:src="@{/js/order.js}"></script>
<script>
    function query(obj) {
        var no=$(obj).attr("data");
        var url="https://m.kuaidi100.com/index_all.html?type=huitongkuaidi&postid="+no+"&callbackurl=##result";
        layer.open({
            type: 2,
            content: url,
            area:  ['1200px', '800px']
        });
    }
    function CloseWebPage() {
        if (navigator.userAgent.indexOf("MSIE") > 0) {
            if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
                window.opener = null; window.close();
            }
            else {
                window.open('', '_top'); window.top.close();
            }
        }
        else if (navigator.userAgent.indexOf("Firefox") > 0) {
            window.location.href = 'about:blank '; //火狐默认状态非window.open的页面window.close是无效的
            //window.history.go(-2);
        }
        else {
            window.opener = null;
            window.open('', '_self', '');
            window.close();
        }
    }
    var header = $("meta[name='_csrf_header']").attr("content");
    var token =$("meta[name='_csrf']").attr("content");

    var sjId;
    var provinceName="",cityName="",areaName="";
    var provinceId=0,cityId=0,areaId=0;
    $(document).ready(function(){
        layui.use('form', function(){
            var form = layui.form;
            form.on('select(selectyj)', function(data){
                var yjId=data.value;
                loadrj(yjId)//调用二级
                provinceName=data.elem[data.elem.selectedIndex].text;
                provinceId=yjId+",";
                $("#address").attr('data',provinceId);
            });
            form.render();

            form.on('select(selectrj)', function(data){
                var rjId=data.value;
                loadsj(rjId);
                cityName=data.elem[data.elem.selectedIndex].text;
                cityId=rjId+",";
                $("#address").attr('data',cityId);
            });
            form.render();

            form.on('select(selectsj)', function(data){
                sjId=data.value;
                areaName=data.elem[data.elem.selectedIndex].text;
                areaId=sjId;
                $("#address").html(provinceName+cityName+areaName);
                $("#address").attr('data',provinceId+cityId+areaId)
            });
            form.render();
        });
        // var date=new Date();
        // var year=date.getFullYear();
        // var productNo=Math.random().toString().substring(2);
        // var str=year.toString()+productNo;
        // $("#productNo").attr("value",str);
    });


    //执行一个laydate实例
    // var data;
    // laydate.render({
    //     elem: '#upTime',//指定元素
    //     format: 'yyyy-MM-dd HH:mm:ss'
    //     ,value: '2017-09-10 10:10:10'
    //     ,done: function (value,date) {
    //         console.log(date);
    //         if(date!=null||date!=""){
    //             data=date;
    //         }else{
    //             alert("请选择商品上传时间！");
    //         }
    //
    //     }
    // });

    //复选框
    var productUp;
    layui.use('form',function () {
        var checkboxform = layui.form;
        checkboxform.on('checkbox(checkbox)',function (data) {
            console.log(data.elem.checked);
            productUp=data.elem.checked;
        })
    })
    var productNo="";
    var productId=0;
</script>

<script>
    var addressid=$.trim($("#address").attr("adid"));

    var a1=$.trim(addressid.split(',')[0]);
    var a2=$.trim(addressid.split(',')[1]);
    var a3=$.trim(addressid.split(',')[2]);
    $(document).ready(function () {
        loadProvince();
        loadrj(a1);
        loadsj(a2);
    })

    function loadProvince() {
        var str = "";
        $.ajax({
            url:"/selectAreaList?parentId=0&level=0",
            dataType: 'json',
            contentType: 'application/json',
            async: false,
            success: function (result) {
                var data=result;
//var datahref=$(data.elem).find("option:selected").attr("data-href");
                for(var index in data){
                    if(data[index].id==a1){
                        $("#yj").append("<option value='" +data[index].id+"'>" + data[index].name+ "</option>");
                        $("#yj").find("option[value='" +data[index].id+"']").prop("selected",true);
                        //form.render();
                    }else {
                        //str = str + "<option value='" +data[index].classId+ "'>" + data[index].classifyName+ "</option>";
                        $("#yj").append("<option value='" +data[index].id+"'>" + data[index].name+ "</option>");
                    }
                }
                //$("#yj").html(str);
            }
        });
    }

    function loadrj(id) {
        var  str="";
        $.ajax({
            url:"/selectAreaList?level=1&parentId="+id,
            success:function (result) {
                var data=result;
                $('#rj').empty();
                for(var index in data){
                    if(data[index].id==a2){
                        $("#rj").append("<option value='" +data[index].id+"'>" + data[index].name+ "</option>");
                        $("#rj").find("option[value='" +data[index].id+"']").prop("selected",true);
                        //form.render();
                    }else {
                        $("#rj").append("<option value='" +data[index].id+"'>" + data[index].name+ "</option>");
                    }
                    // $("#rj").append("<option value='" +data[index].id+ "'>" + data[index].name+ "</option>");
                    layui.use('form', function() {
                        var form = layui.form;
                        form.render();
                    })
                }
            }
        })
    }

    function loadsj(id) {
        var  str="";
        $.ajax({
            url:"/selectAreaList?level=2&parentId="+id,
            success:function (result) {
                var data=result;
                $('#sj').empty();
                for(var index in data){
                    if(data[index].id==a3){
                        $("#sj").append("<option value='" +data[index].id+"'>" + data[index].name+ "</option>");
                        $("#sj").find("option[value='" +data[index].id+"']").prop("selected",true);
                        //form.render();
                    }else {
                        $("#sj").append("<option value='" +data[index].id+"'>" + data[index].name+ "</option>");
                    }
                    //$("#sj").append("<option value='" +data[index].id+ "'>" + data[index].name+ "</option>");
                    layui.use('form', function() {
                        var form = layui.form;
                        form.render();
                    })
                }
            }
        })
    }
</script>
</html>